package fr.upmc.alasca.centreCalcul.outils;

import java.util.Random;


/**
 * @author Antoine Lavaire, Sabri Labassi, Thibaut Fleury, Ryme Fantazi
 */
public	class	LoiNormale
{
	/* -------------------------------------------------------------- METHODE */
	public	static	long	getNext
	(
		long	p_moyenne,
		long	p_ecartType
	) {
		Random r = new Random();
		double u = r.nextDouble();
		double v = r.nextDouble();
		double x = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
		
		return (long) (x * p_ecartType + p_moyenne);
	}
}
